<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 引入 ElementUI 样式 -->
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css" />
    <script src="../js/vue.js"></script>
    <!-- 引入 ElementUI 组件库 -->
    <script src="../js/index.js"></script>
  </head>
  <body>
    <div id="app">
      <!-- @current-change：内置的事件，当前页码改变时会触发，可以获取到改变之后的页码 -->
      <el-pagination
        @current-change="handleCurrentChange"
        current-page="5"
        page-size="10"
        layout="total, prev, pager, next, jumper"
        :total="305"
      >
      </el-pagination>
    </div>
    <script>
      new Vue({
        el: "#app",
        // 定义 VUE 对象的方法
        methods: {
          handleCurrentChange(page) {
            alert(page);
          },
        },
      });
    </script>
  </body>
</html>
